## Mapped scATAC-Seq libraries have to merged (using samtools) and deduplicated (using PICARD). Narrow Peaks (HARs) can be determined using MACS2.
## For ChtromVAR, mapped scATAC-Seq libraries has to be deduplicated using PICARD at a single-cell level.
## Deduplication Metrices include information about the percentage of Duplication in each library (Used to compare performance of ASTAR with other publisehd bimodal techniques).

## Merging single-cell mapped files:

samtools merge -@ 10 /Path/To/Output/Merged/File.bam /Path/To/Library1.bam /Path/To/Library2.bam ...... /Path/To/Library(n).bam


## Removing Duplicates from merged file  (CAN ALSO BE USED FOR EACH CELL FOR DEDUPLICATION AT SINGLE-CELL LEVEL): 

java -Xmx70g -jar /Path/To/picard.jar MarkDuplicates I=/Path/To/Merged/File.bam O=/Path/To/Output/Deduplicated.bam M=/Path/To/Deduplication_Metrices.txt REMOVE_DUPLICATES=TRUE


## Calling Peaks to determine HARs (narrowPeaks file):

macs2 callpeak -t /Path/To/Deduplicated.bam -f BAM -n Name -g (mm for mouse or hs for human libraries) --outdir /Path/To/Output/ --nolambda --nomodel --keep-dup all --call-summits



